package com.fz.mapper;

import com.fz.entity.Artist;
import com.fz.entity.College;
import com.fz.entity.Province;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Z-C-Y on 2018-03-05.
 * artist.jsp   艺术家
 */
@Service
public interface WebArtistMapper {
    /*作者省份*/
    public List<Province> queryProvince();
    /*毕业美院*/
    public List<College> queryCollege();
    /*精准搜索==先接受页面传了的数据，向数据库进行查询后===再返回查询的数据*/
    public List<Artist> queryName(@Param("a_name") String a_name);

    /*实现分页并查询*/
    /*分页======查询数据库的数据的总数据*/
    @Select("select * from artist")
    public List<Artist> queryArtist();
    //有了pageSize和startIndex，就可以拿到每页的数据
    @Select("select * from artist limit #{startIndex},#{pageSize}")
    public List<Artist> queryData(@Param("startIndex") int startIndex,@Param("pageSize") int pageSize);
}
